﻿@page "/tests/livecharts"
<Row>
    <Column ColumnSize="ColumnSize.IsHalf.OnWidescreen">
        <Card Margin="Margin.Is4.OnY">
            <CardHeader>
                <CardTitle>Horizontal Line</CardTitle>
            </CardHeader>
            <CardBody>
                <LineChart @ref="@horizontalLineChart" TItem="LiveDataPoint" OptionsObject="@horizontalLineChartOptions">
                    <ChartStreaming @ref="@horizontalLineChartStreaming"
                                    TItem="LiveDataPoint"
                                    Options="new ChartStreamingOptions { Delay = 2000 }"
                                    Refreshed="@OnHorizontalLineRefreshed" />
                </LineChart>
            </CardBody>
            <CardFooter>
                <Button Color="Color.Primary" Outline Clicked="@AddNewHorizontalLineDataSet">Add DataSet</Button>
                <Button Color="Color.Secondary" Outline Clicked="@AddNewHorizontalLineData">Add Data</Button>
                <Button Color="Color.Primary" Outline Clicked="@PauseHorizontalLineChart">Pause</Button>
                <Button Color="Color.Primary" Outline Clicked="@PlayHorizontalLineChart">Play</Button>
            </CardFooter>
        </Card>
    </Column>
    <Column ColumnSize="ColumnSize.IsHalf.OnWidescreen">
        <Card Margin="Margin.Is4.OnY">
            <CardHeader>
                <CardTitle>Vertical Line</CardTitle>
            </CardHeader>
            <CardBody>
                <LineChart @ref="verticalLineChart" TItem="LiveDataPoint" OptionsObject="@verticalLineChartOptions">
                    <ChartStreaming TItem="LiveDataPoint"
                                    Vertical
                                    Options="new ChartStreamingOptions { Delay = 2000 }"
                                    Refreshed="@OnVerticalLineRefreshed" />
                </LineChart>
            </CardBody>
            <CardFooter>
                <Button Color="Color.Primary" Outline Clicked="@AddNewVerticalLineDataSet">Add DataSet</Button>
                <Button Color="Color.Secondary" Outline Clicked="@AddNewVerticalLineData">Add Data</Button>
            </CardFooter>
        </Card>
    </Column>
</Row>
<Row>
    <Column ColumnSize="ColumnSize.IsHalf.OnWidescreen">
        <Card Margin="Margin.Is4.OnY">
            <CardHeader>
                <CardTitle>Horizontal Bar</CardTitle>
            </CardHeader>
            <CardBody>
                <BarChart @ref="horizontalBarChart" TItem="LiveDataPoint" OptionsObject="@horizontalBarChartOptions">
                    <ChartStreaming TItem="LiveDataPoint"
                                    Options="new ChartStreamingOptions { Delay = 2000 }"
                                    Refreshed="@OnHorizontalBarRefreshed" />
                </BarChart>
            </CardBody>
            <CardFooter>
                <Button Color="Color.Primary" Outline Clicked="@AddNewHorizontalBarDataSet">Add DataSet</Button>
                <Button Color="Color.Secondary" Outline Clicked="@AddNewHorizontalBarData">Add Data</Button>
            </CardFooter>
        </Card>
    </Column>
    <Column ColumnSize="ColumnSize.IsHalf.OnWidescreen">
        <Card Margin="Margin.Is4.OnY">
            <CardHeader>
                <CardTitle>Vertical Bar</CardTitle>
            </CardHeader>
            <CardBody>
                <BarChart @ref="verticalBarChart" TItem="LiveDataPoint" OptionsObject="@verticalBarChartOptions">
                    <ChartStreaming TItem="LiveDataPoint"
                                    Vertical
                                    Options="new ChartStreamingOptions { Delay = 2000 }"
                                    Refreshed="@OnVerticalBarRefreshed" />
                </BarChart>
            </CardBody>
            <CardFooter>
                <Button Color="Color.Primary" Outline Clicked="@AddNewVerticalBarDataSet">Add DataSet</Button>
                <Button Color="Color.Secondary" Outline Clicked="@AddNewVerticalBarData">Add Data</Button>
            </CardFooter>
        </Card>
    </Column>
</Row>